#include <iostream>
using namespace std;

int removeElement(int A[], int n, int elem) {
    // Start typing your C/C++ solution below
    // DO NOT write int main() function
    int iRead = 0;
    int iWrite = 0;
    for(iRead=0; iRead<n; ++iRead){
        if(A[iRead] != elem){
            A[iWrite] = A[iRead];
            ++iWrite;
        }
    }

    return iWrite;
}


int main(){
    return 0;
}